package com.aiowang.springboot.dynamic.activemq.config;

import org.apache.activemq.ActiveMQConnectionFactory;

/**
 * @author aiowang
 * @date 2020-03-17 21:23
 */
public class AMQCFFactory {

    public static ActiveMQConnectionFactory createProduct(DynamicActivemqProperties dynamicActivemqProperties){

        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory();
        factory.setBrokerURL(dynamicActivemqProperties.getBrokerUrl());
        factory.setUserName(dynamicActivemqProperties.getUser());
        factory.setPassword(dynamicActivemqProperties.getPassword());
        factory.setClientIDPrefix(dynamicActivemqProperties.getClientIDPrefix());


        return factory;
    }
}
